package personnel.department.dao.entity;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.time.DateUtils;

@Entity
@Table(name="validation")
public class Validation implements UniqueObject {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id")
	private Long id;

	@Column(name="assignment_date")
	private Date assignmentDate;

	@Column(name="confirmation")
	private Date confirmation;

	@Column(name="first_category")
	private Boolean firstCategory;

	@Column(name="second_category")
	private Boolean secondCategory;

	@Column(name="higher_category")
	private Boolean higherCategory;
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="employee_Id")
	private Employee employee;

	public Validation() {
	}

	public Validation(List<Object> params) {
		this.assignmentDate = (Date)params.get(0);
		this.confirmation =   (Date)params.get(1);
		this.firstCategory =  (Boolean)params.get(2);
		this.secondCategory = (Boolean)params.get(3);
		this.higherCategory = (Boolean)params.get(4);
	}

	public Long getId() {
		return id;
	}

	public Date getAssignmentDate() {
		return assignmentDate;
	}

	public Date getConfirmation() {
		return confirmation;
	}

	public Boolean getFirstCategory() {
		return firstCategory;
	}

	public Boolean getSecondCategory() {
		return secondCategory;
	}

	public Boolean getHigherCategory() {
		return higherCategory;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setAssignmentDate(Date assignmentDate) {
		this.assignmentDate = assignmentDate;
	}

	public void setConfirmation(Date confirmation) {
		this.confirmation = confirmation;
	}

	public void setFirstCategory(Boolean firstCategory) {
		this.firstCategory = firstCategory;
	}

	public void setSecondCategory(Boolean secondCategory) {
		this.secondCategory = secondCategory;
	}

	public void setHigherCategory(Boolean higherCategory) {
		this.higherCategory = higherCategory;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}


}
